package com.feng.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("/file")
public class FileController {

    @RequestMapping("/sentFile")
    public String getFile(@RequestParam("file") CommonsMultipartFile file, HttpServletRequest request, HttpServletResponse response){
        System.out.println(file.getOriginalFilename());
        return "book/allBook";
    }
}
